home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / sendVideo.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  2.2 KB  |  86 lines  |  [TEXT/MPS ]

  1. (*
  2.     sendVideo cmd,opt - Send the command string cmd to the video player and wait for an
  3.         acknowledgement. In the case of some players, the opt parameter supplies additional
  4.         information or options on how to proceed:
  5.  
  6.             player        opt meaning
  7.             ————        ————————
  8.             Sony            If present, don't clear previous commands.
  9.             Hitachi        If present, wait for this as acknowledgement from player, rather than waiting
  10.                             for the command character sent.
  11.  
  12.         In the case of the Pioneer 6000 player, numeric parameters embedded in the cmd should be
  13.         surrounded with periods (as in '.1000.'). sendVideo will then translate to the appropriate
  14.         input to the player.
  15.  
  16.     To compile and link this file using Macintosh Programmer's Workshop,
  17.  
  18.         pascal -w sendVideo.p
  19.  
  20.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=8005 -sn Main=sendVideo ∂
  21.             sendVideo.p.o "{MPW}"Libraries:interface.o "{MPW}"PLibraries:PasLib.o
  22.  
  23.     Copyright © 1987,88 Apple Computer, Inc.
  24.  
  25.     9/87 - Initial coding by Harry R. Chesley.
  26.     2/88 - Changed for new interface specification by Harry R. Chesley.
  27. *)
  28.  
  29. {$R-}
  30.  
  31. {$S sendVideo }     { Segment name must be the same as the command name. }
  32.  
  33. unit DummyUnit;
  34.  
  35. interface
  36.  
  37. uses MemTypes, QuickDraw, OSIntf, HyperXCmd;
  38.  
  39. procedure EntryPoint(paramPtr: XCmdPtr);
  40.     
  41. implementation
  42.  
  43. type
  44.  
  45. Str31 = String[31];
  46.  
  47. procedure sendVideo(paramPtr: XCmdPtr); forward;
  48.  
  49. procedure EntryPoint(paramPtr: XCmdPtr);
  50.  
  51.     begin
  52.         sendVideo(paramPtr);
  53.     end;
  54.  
  55. procedure sendVideo(paramPtr: XCmdPtr);
  56.  
  57.     var numberOfParms: integer;
  58.         str, str2: str255;
  59.  
  60.     {$I XCmdGlue.inc}
  61.  
  62.     procedure Fail(errMsg: Str255); { set theResult and quit }
  63.         begin
  64.             paramPtr^.returnValue := PasToZero(errMsg);
  65.             exit(sendVideo);
  66.         end;
  67.  
  68.     {$I VideoUtil.inc}
  69.  
  70.     begin
  71.         numberOfParms := paramPtr^.paramCount;
  72.         if (numberOfParms <> 1) and (numberOfParms <> 2) then Fail('parameter count is not 1 or 2');
  73.  
  74.         GetStrParm(1,str);                                                    { First parameter is the string to send. }
  75.         if numberOfParms > 1 then GetStrParm(2,str2)        { Second is the optional parameter for this player. }
  76.         else str2 := '';
  77.  
  78.         { Clear out any pending input. }
  79.         EvalAndDispose('RecvUpTo(empty,0,empty)');
  80.  
  81.         { Send it... }
  82.         videoCmd('sendCmd',Concat('"',str,'","',str2,'"'));
  83.     end;
  84.  
  85. end.
  86.